#!/bin/bash
cd dist
rm -rf gomonitor-server_amd64_linux
tar -zxvf gomonitor-server_amd64_linux.tar.gz
mv gomonitor-server_amd64_linux gomonitor-server
cp gomonitor-server/gomonitor-server_amd64_linux gomonitor-server_amd64_linux
cd ..
ssh -p 2222 root@crux-backup85 "cd /data/gomonitor-server/ ; sh stop.sh ; rm -rf gomonitor-server_amd64_linux"
scp -P 2222 ./dist/gomonitor-server_amd64_linux root@crux-backup85:/data/gomonitor-server/
ssh -p 2222 root@crux-backup85 "cd /data/gomonitor-server/ ; rm -rf ./logs/* ;  sh start.sh"
rm -rf ./dist/gomonitor-server
rm -rf ./dist/gomonitor-server_amd64_linux
